﻿<%@page contentType="text/vnd.wap.wml; charset=utf-8"%>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.*"%>
<%@ page import="common.*"%>
<%@ page import="wapbean.*"%>

<?xml version="1.0" encoding="utf-8"?>   
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org//DTD//wml_1.1.xml">   
<wml>
<%     // String Pro=(String)session.getAttribute("ProviderID");  
       // System.out.println("ProProProPro="+Pro); 
        String name=(String)session.getAttribute("name"); 
        String Byname=(String)session.getAttribute("Byname");  
    	String purl = (String) session.getAttribute("p");
        ContentFactory Fac= new ContentFactory();
//        WapcategoryFactory Fac1 = new WapcategoryFactory();  
//        SecondUrl second=new SecondUrl();
        Vector vc = Fac.getMobilemodelBean();      
      boolean find = false;
       String MobileName=null;
	if (vc != null && !vc.isEmpty()) {
		int n = vc.size();
	//	System.out.println("nnnnnn=" + n);
		//循环获取url
		//String prid=null;
		for (int j = 1; j < n; j++) {
			MobilemodelBean ab = (MobilemodelBean) vc.elementAt(j);
			String description = ab.getDescription();
			  MobileName=ab.getMobileName();
			//prid = ab.getProviderID();
			
			String[] p = description.split(";");
		//	System.out.println("pppppp=" + p);
			int k;
			//判断当前机型是否包含访问中带的机型----------------begin
				for ( k = 0; k < p.length; k++) { 
					if (purl.equals(p[k])) { 
						find = true;
		    	//System.out.println("获取到url=" + purl);
					  break;   
					}
				}
			//判断当前机型是否包含访问中带的机型----------------end
			if(find){
				break;  
			}

	   }
	   // System.out.println("MobileName=" + MobileName); 
	   //for 循环结束
	   
	   //-------------------------------begin
	   				
			//判断当前url是否与访问url相等----------------begin
			//判断是否获取到对应url--------------begin 
			if(!find){//没找到
			//如果没有找到对应机型，但是url又不为空，则跳转到雅维28
				  purl="yw28";  
		         
			//	 System.out.println("pgggggggggggggggggggggggggggggggggggg=" + find);
			//	  System.out.println("pgggggggggggggggggggggggggggggggggggg=" + purl);
			}else{//找到了对应的机型，如果没有内容，则跳转到维护页面
				if(vc == null || vc.isEmpty()){
		    //  System.out.println("ggggg=" + find);   
				%>
	    		 <jsp:forward page="wappages/anc.jsp"></jsp:forward>
	    		<% 
	    		 }else{
	    		//	  System.out.println("ffffffffffff=" + find); 
	    			  System.out.println("game3.0=" + purl);    
	    		 }  
			}
		}
	   //----------------------------------end    
	             NewFactory newF= new NewFactory();  
	             MobilemodelBean Mobilemodel = newF.getmobilemodelDescription(purl);   
	    	      String  MobileModelID=Mobilemodel.getMobileModelID();
	    	      String  ProviderID=Mobilemodel.getProviderID();
	    	 //     System.out.println("mobileModelid=" + MobileModelID);
	    	 //     System.out.println("providerid=" + ProviderID);
	    	       Vector newvc = newF.getWapcategory(MobileModelID);
	    	       WapcategoryFactory Fac1 = new WapcategoryFactory();
	    	       
	%> 
<card id="card1" title="乐游-<%//=pb.getName()%>专区">          
<p align="left">

 <img src="/game3.0/img/logo.png" alt=""/>  
	<br />
	<%//if(MobileName.equals("28")){  
	//System.out.println("MobileName=*===="+MobileName);
	%><%if(purl.equals("htk8")){%>
	欢迎进入全触摸世界！<br />
	<%} %>
	            <% 
	             int a=2;
	            if(newvc!=null){  
                   int r=newvc.size();   
                   for(int q=0;q<r;q++){
                   Allbean bea=(Allbean)newvc.elementAt(q);  
                   
            if (bea.getCategoryTypeID().equals("12")) {%> 
             【<a href="/game3.0/wappages/gameList.jsp?CategoryID=<%=bea.getCategoryID()%>&amp;MobileModelID=<%=MobileModelID%>&amp;ProviderID=<%=ProviderID%>&amp;purl=<%=purl%>"><%out.println(bea.getTitle());%></a>】
	
		    <% } %>
		    <%
		if((q+1)%a==0){%>   
		<br />
	<%}
              if (bea.getCategoryTypeID().equals("13")) {%>              
          【<a href="/game3.0/wappages/gameList.jsp?CategoryID=<%=bea.getCategoryID()%>&amp;MobileModelID=<%=MobileModelID%>&amp;ProviderID=<%=ProviderID%>&amp;purl=<%=purl%>"><%out.println(bea.getTitle());%></a>】 <br />                      
	     <%}
	                Vector ver4;
					ver4 = newF.getMobilemodelContentlist(bea.getCategoryID(),MobileModelID);
   	                if(ver4!=null){  
                    int a1=ver4.size(); 
              
                    for(int t=0;t<a1;t++){
                    Allbean bea4=(Allbean)ver4.elementAt(t);  
                    %>
                    <a href="/game3.0/wappages/contentgameview.jsp?CategoryID=<%=bea.getCategoryID()%>&amp;contentId=<%=bea4.getContentId()%>&amp;MobileModelID=<%=MobileModelID%>&amp;ProviderID=<%=ProviderID%>&amp;purl=<%=purl%>&amp;ContentResourceID=<%=bea4.getContentResourceID()%>&amp;cpId=<%=bea4.getCpId()%>&amp;submitCode=<%=bea4.getSubmitCode()%>&amp;gameresourceid=<%=bea4.getGameResourceID()%>"> 
	<%=bea4.getTitle()%></a><br /> 
	     
	     <%}}}} %>     	
	【<a href="wappages/helpgame.jsp?purl=<%=purl%>">客服咨询</a>】      
	<br />  						 	    
	wap.leyoou.cn    
	

	</p>
</card>
</wml>